#include "vector_utils.h"

#include <cassert>

namespace utils {
template<typename T>
constexpr T& GetVectorElement(std::vector<T> &vec, std::ptrdiff_t index) noexcept
{
    assert(index >= 0 && static_cast<std::size_t>(index) < vec.size());
    return vec[static_cast<std::size_t>(index)];
}

template<typename T>
constexpr const T& GetVectorElement(const std::vector<T> &vec, std::ptrdiff_t index) noexcept
{
    assert(index >= 0 && static_cast<std::size_t>(index) < vec.size());
    return vec[static_cast<std::size_t>(index)];
}
}